package com.opennews.openplatform.dto.journey.income.expense.detail;

import com.opennews.openplatform.myspringbootcore.dto.IdentityDto;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Getter
@Setter
public abstract class BaseJourneyIncomeExpenseDetailDto {
    private IdentityDto journey;
    private IdentityDto bankCard;

    @NotNull(message = "location can't be null")
    private String location;

    @NotNull(message = "currency can't be null")
    private String currency;

    @NotNull(message = "amount can't be null")
    private BigDecimal amount;

    @NotBlank(message = "amount can't be blank")
    private String type;                 // IncomeExpenseTypeConstant

    @NotBlank(message = "paymentType can't be blank")
    private String paymentType;          // PaymentTypeConstant

    @NotBlank(message = "details can't be blank")
    @Size(max = 100, message = "details must be at most 100 characters")
    private String details;

    @Size(max = 100, message = "remark must be at most 100 characters")
    private String remark;

    @NotNull(message = "incomeExpenseDate can't be null")
    private LocalDateTime incomeExpenseDate;

    private BigDecimal latitude;         // 坐标纬度，GCJ02火星坐标系。
    private BigDecimal longitude;        // 坐标经度，GCJ02火星坐标系。
    private String address;              // 根据经纬度从地图API获取的地址信息，由逗号间隔，如中国,浙江省,杭州市,萧山区,北干街道。
    private String formattedAddress;     // 根据经纬度从地图API获取的格式化后的地址信息，如浙江省杭州市萧山区北干街道博奥路。
    private String province;             // 根据经纬度从地图API获取的坐标点所在省名称，例如：北京市。
    private String city;                 // 根据经纬度从地图API获取的坐标点所在城市名称，请注意：当城市是省直辖县时返回为空，以及城市为北京、上海、天津、重庆四个直辖市时，该字段返回为空。
    private String district;             // 根据经纬度从地图API获取的坐标点所在区，例如：海淀区。
}
